package com.dongdongshop.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dongdong.pojo.TbContent;
import com.dongdong.service.ContentService;
import com.dongdongshop.configresult.Result;
import com.dongdongshop.em.ResultEnum;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("tbContentController")
public class TbContentController {

    @Reference
    private ContentService contentService;

//    查询展示页面
    @RequestMapping("select")
    @ResponseBody
    public Result select(@RequestParam("id") Long id){
        List<TbContent> contents = contentService.selectcID(id);
        return Result.builResult(ResultEnum.SUCCESS).setResout(contents);
    }

//    查询猜你喜欢
    @RequestMapping("live")
    @ResponseBody
    public Result live(@RequestParam("id")Long id){
        List<TbContent> contents = contentService.selectcID(id);
        return Result.builResult(ResultEnum.SUCCESS).setResout(contents);
    }

//    查询轮播图
    @RequestMapping("CarouselChart")
    @ResponseBody
    public Result CarouselChart(@RequestParam("id")Long id){
        List<TbContent> contents = contentService.selectcID(id);
        return Result.builResult(ResultEnum.SUCCESS).setResout(contents);
    }

    //    查询有趣区
    @RequestMapping("Imagination")
    @ResponseBody
    public Result Imagination(@RequestParam("id")Long id){
        List<TbContent> contents = contentService.selectcID(id);
        return Result.builResult(ResultEnum.SUCCESS).setResout(contents);
    }

}
